<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" import="java.util.*"%>
<%@ page import="com.itr.kbm.model.SessionDataObject"%>

<%
	if (session.getAttribute("logindata") == null) {
		response.sendRedirect(request.getContextPath() + "/billing/");
%>
<br />
<h4>
	You are not logged in !! Go to <a class=""
		href="${pageContext.request.contextPath}/billing/"> Register Page
	</a>
</h4>
<br />
<%
	} else {
		SessionDataObject object = (SessionDataObject) session
				.getAttribute("logindata");
%>
<div class="col-md-9">
	<div class="row">

		<form role="form" name="summary-form" id="summary-form"
			action="${pageContext.request.contextPath }/request-logout">
			<div class="form-group">
				<div class="col-md-9">
					<br />
					<h4>Hi, <%=object.getKodeKopeg()%> <%=object.getKodeKoptelProduct()%> !! ~ Welcome to
						Billing Management ~</h4>
				</div>
			</div>
			<div class="form-group">
				<div class="col-md-3">
					<input type="submit" id="show-report-button" name="submit"
						value="Log Out" class="form-control btn btn-default" />
				</div>
			</div>
		</form>
		<br /> <br />
		<h2>CHANGE PASSWORD</h2>
	</div>
	<div class="row form-row">
		<form class="form-horizontal" role="form" name="summary-form"
			id="summary-form"
			action="${pageContext.request.contextPath }/request-change_password">
			<div class="wrap_div_form">
				<div class="form-group first-form-group">
					<label for="inputEmail1" class="col-lg-2 control-label">
						Old Password</label>
					<div class="col-lg-4">
						<input type="password" class="form-control" id="old" name="old"
							placeholder="old password" value="">
					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail1" class="col-lg-2 control-label">
						New Password</label>
					<div class="col-lg-4">
						<input type="password" class="form-control" id="new" name="new"
							placeholder="new password" value="">
					</div>
				</div>
				<div class="form-group">
					<label for="inputEmail1" class="col-lg-2 control-label">
						Confirm Password</label>
					<div class="col-lg-4">
						<input type="password" class="form-control" id="confirm"
							name="confirm" placeholder="confirm password" value="">
					</div>
				</div>
				<div class="form-group">

					<div class="form-group">
						<div class="col-lg-offset-2 col-lg-10">
							<input type="submit" id="show-report-button" name="submit"
								value="Change Password" class="btn btn-default" />
						</div>
					</div>
				</div>
			</div>
			<c:if test="${icon.equals('fail')}">

				<h5 style="color: red; border-style: solid;">
					<img
						src="${pageContext.request.contextPath}/assets/img/icon/fail.png"
						width="40px">${alert }
				</h5>
			</c:if>
			<c:if test="${icon.equals('success')}">

				<h5 style="color: green; border-style: solid;">
					<img
						src="${pageContext.request.contextPath}/assets/img/icon/success.png"
						width="40px">${alert }
				</h5>
			</c:if>
		</form>
	</div>

	<br />
</div>
<%
	}
%>
<script type="text/javascript">
	$(document)
			.ready(
					function() {

						$("#upload-form")
								.validate(
										{
											/*submitHandler: function(theForm) {
												showLoadingScreen();
												$("#submit-upload-form").attr("disabled");
												theForm.submit();
												setTimeout(showTable,3000);
											},*/

											rules : {
												"report-file" : {
													required : true,
													accept : "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
												}
											},
											messages : {
												"report-file" : {
													required : "Please choose an excel file first",
													accept : "Please choose an excel file type only"
												}
											}
										});
					});
	function showTable() {
		$(".table-row table").show();
		hideLoadingScreen();
	}
</script>

<style type="text/css">
h2 {
	border-radius: 4px 4px 0 0;
	padding: 10px 15px;
	font-size: 16px;
	margin: 0px;
	background-color: #27ae60;
	color: #fff;
}

input[type=file].form-control {
	height: auto;
}

.form-row {
	background-color: #f3f3f3;
	padding-bottom: 15px;
}

.table-row {
	padding: 15px 0;
	font-size: 12px;
}

.table-row table th {
	text-align: center;
	vertical-align: middle !important;
}

.false td {
	background-color: #ff5e63 !important;
	color: #fff;
}

.form-control {
	padding: 3px;
}
</style>